package com.xiaow.springsecuriydemo.utils;

import com.xiaow.springsecuriydemo.vo.LoginUser;
import org.springframework.security.core.context.SecurityContextHolder;


/**
 * @ClassName UserUtils
 * @Author xiaow
 * @DATE 2022/9/19 21:11
 **/

public class UserUtils {

    public static LoginUser getUser() {
        LoginUser loginUser = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return loginUser;
    }
}
